// ES5  
// 方法1 通过原型链实现继承
function A() {
    let result = {
        name: '小明',
        age: '19'
    }
}
A.prototype.getAge = function () {
    return this.result.age;
}
// let x = new A()  x.getAge() //19

// 方法2 通过构造函数继承
function B() {
    let result = {
        name: '小明',
        age: '19'
    }
}
let C = new B();
function D() {
    return C.result;
}

// ES6 
class X {
    constructor(name) {
        this.name = 'xiaoming'
    }
}
class Y extends X {
    constructor(name) {
        super(name)
    }
}
